<?php
$file = fopen("D:\\E\\code\\rssd_svn\\branches\\branch-1.0\\db\\cartridge.txt", "r");
if (!$file) { 
    exit("Unable to open file!");
}
//Output a line of the file until the end is reached
$outputFile = "D:\\E\\code\\rssd_svn\\branches\\branch-1.0\\db\\cartridgeSql.txt";
$i = 1;
while(!feof($file))
{
    $cartridge = trim(fgets($file));
    echo $cartridge. "\n";
    $sql = "({$i}, 0, '{$cartridge}', '{\"10\":\"0\",\"20\":\"0\",\"21\":\"0\",\"24\":\"0\",\"28\":\"0\"}', '2012-12-06 20:52:27'),\n";
    error_log($sql, 3, $outputFile);
    $i++;
}
fclose($file);
?>